@page "/app/{AppId}/credentials/user/{UserId}"
@inherits BaseApplicationPage

@inject IScopedPasswordlessClient ApiClient

<Page Title="User Details">
    <p id="user-details-summary">This pages summarizes the information for user <Badge Message="@UserId"/></p>
    <Panel Header="Credentials">
        <Credentials HideDetails="@HideCredentialDetails" PasswordlessClient="@ApiClient" UserId="@UserId"/>
    </Panel>
    <Panel Header="Aliases">
        <Alert Style="@ContextualStyles.Info">Please note that aliases that are hashed cannot be shown in plaintext.</Alert>
        @if (Aliases != null)
        {
        <ul class="list-disc mt-4">
            @foreach (var alias in Aliases)
            {
                @if (!string.IsNullOrEmpty(alias.Plaintext))
                {
                    <li class="ml-8">@alias.Plaintext</li>
                }
                else
                {
                    <li class="ml-8 italic">Hashed alias</li>
                }
            }
        </ul>
        }
    </Panel>
</Page>